<%@ page isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>SpringMVC 测试页</title>


  <script type="text/javascript" src="https://code.jquery.com/jquery-3.4.1.min.js"></script>

  <script>
    $(function () {

      $("#ajaxBtn").bind("click", function () {
        // 发送ajax请求
        $.ajax({
          url: '/demo/handle07',
          type: 'POST',
          data: '{"id":"1","name":"李四"}',
          contentType: 'application/json;charset=utf-8',
          dataType: 'json',
          success: function (data) {
            alert(data.name);
          }
        })

      })


    })
  </script>


  <style>
    div {
      padding: 10px 10px 0 10px;
    }
  </style>
</head>
<body>

<div class="container">
  <h2>我是服务器：${pageContext.request.localPort}</h2>
  <h2>当前sessionId：${pageContext.session.id}</h2>
  <div class="row clearfix">
    <div class="col-md-12 column">
      <form class="form-horizontal" role="form" action="login" method="post">
        <div class="form-group">
          <label for="name" class="col-sm-2 control-label">name</label>
          <div class="col-sm-10">
            <input type="name" class="form-control" id="name" name="name"/>
          </div>
        </div>
        <div class="form-group">
          <label for="password" class="col-sm-2 control-label">Password</label>
          <div class="col-sm-10">
            <input type="password" class="form-control" id="password" name="password"/>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default">Sign in</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>

</body>
</html>
